package org.apple.console;

import java.util.ArrayList;
import java.util.Random;

public class ViewController {
	protected BoiyFrame face;
	
	protected ArrayList<String> datas;
	protected GraphPanel panel;
	
	public synchronized void receiveData(String data) {
		// this.datas.add(data);
		// this.panel.repaint();
		panel.receiveData(data);
		
	}
	
	public ViewController() {
		this.datas = new ArrayList<String> ();
		
		// this.panel = new GraphPanel(datas);
		
		this.face = new BoiyFrame (panel);
	}
	public static void main(String[] args) throws Exception {
		ViewController controller = new ViewController();
		
		Random random = new Random();
		for (int i = 0; i < 10000; i ++) {
			Thread.sleep(3000);
			controller.receiveData("" + random.nextDouble());
		}
		Thread.sleep(3000);
		controller.receiveData("" + random.nextDouble());
		Thread.sleep(3000);
		controller.receiveData("" + random.nextDouble());
		Thread.sleep(3000);
		
	}
	
	
}
